<template>
  <div id="frame">
    <el-container class="def-container">
      <el-header class="def-header">
        <my-header :arg="clientIp" @say="handleSay" />
      </el-header>
      <el-main class="def-main">
        <router-view />
      </el-main>
    </el-container>
  </div>
</template>

<script>
import MyHeader from './Header.vue'

export default {
  name: 'Frame',
  components: {
    MyHeader
  },
  data () {
    return {

    }
  },
  methods: {
    handleSay (time) {
      this.$message({
        showClose: true,
        message: time,
        type: 'warning'
      })
    }
  },
  computed: {
    clientIp () {
      let clientIp = JSON.parse(localStorage.getItem('loginUser')).clientIp

      return clientIp
    }
  }
}
</script>

<style lang="stylus" scoped>
#frame
  height 100%
  .def-container
    height 100%
    .def-header
      padding 0
      position relative
    .def-main
      padding 0
      height 100%
</style>
